<!-- eslint-disable prettier/prettier -->
<template>
  <view class="content">
    <uni-card title="基础卡片" sub-title="副标题" extra="额外信息"
      thumbnail="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png">
      <text>这是一个带头像和双标题的基础卡片，此示例展示了一个完整的卡片。</text>
    </uni-card>

    <view class="text-area">
      <text class="title">{{ title }}</text>
    </view>
    <view>
      <button @tap="getData">测试接口请求</button>
    </view>
  </view>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { http } from '@/utils/http'
import { useMemberStore } from '@/stores'

const title = ref('Hello UniApp')
const memberStore = useMemberStore()

// 测试接口请求
interface IBanner {
  hrefUrl: string
  id: string
  imgUrl: string
  type: string
}
const getData = async () => {
  // 传递返回数据定义result泛型的具体类型的类型
  const res = await http<IBanner[]>({
    method: 'GET',
    url: '/home/banner',
    header: {},
  })
  console.log(res.result[0].imgUrl)
}
</script>

<style scoped lang="scss"></style>
